<template>
	<view class="page-box" style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
		<view>
			
		</view>
	</view>
</template>

<script>
	import {
		sharePoster
	} from "@/api/index.js"
	export default {
		data() {
			return {
				imgMsg: {},
			}
		},
		onLoad() {
		},
		onTabItemTap() {
			
			var getParam = function(path, name) {
				var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
				if (reg.test(path))
					return unescape(RegExp.$2.replace(/\+/g, " "));
				return "";
			};
			
			uni.scanCode({
				onlyFromCamera: true,
				autoZoom: false,
				success: (res) => {
					setTimeout(() => {
						console.log(res);
						const bid = getParam(res.result, "bid");
						const bindbid = getParam(res.result, "bindbid");
						if (bid != '' || bindbid != '') {
							uni.navigateTo({
								url: `/business/pages/business_tab/qrCodePay?bid=${bid}&bindbid=${bindbid}`
							})
						} else {
							uni.showToast({
								title: '无效二维码'
							});
						}
					}, 800)
				}
			});
		},
		methods: {
			
		}
	}
</script>

<style>
	page {
	}
	
	.page-box{
		height: 100%;
	}
</style>
